using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities.Auditing;

namespace BW.WMS.WareHouseManage
{
    /// <summary>
    /// 仓库实体
    /// </summary>
    public class Warehouse : FullAuditedAggregateRoot<Guid>
    {
        /// <summary>
        /// 仓库编码
        /// </summary>
        public string Code { get; set; }
        
        /// <summary>
        /// 仓库名称
        /// </summary>
        public string Name { get; set; }
        
        /// <summary>
        /// 仓库地址
        /// </summary>
        public string Address { get; set; }
        
        /// <summary>
        /// 状态 (0-停用，1-启用,2-锁定)
        /// </summary>
        public int Status { get; set; }
        
        /// <summary>
        /// 联系人
        /// </summary>
        public string ContactPerson { get; set; }
        
        /// <summary>
        /// 联系电话
        /// </summary>
        public string ContactPhone { get; set; }

        /// <summary>
        /// 仓库面积（平方米）
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal Area { get; set; }
        
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }
        
        /// <summary>
        /// 仓库类型 (1-原料仓，2-成品仓，3-半成品仓，4-备件仓)
        /// </summary>
        public int WarehouseType { get; set; }
        
        /// <summary>
        /// 仓库主管
        /// </summary>
        public string Manager { get; set; }
        
        /// <summary>
        /// 库管部门
        /// </summary>
        public string Department { get; set; }

        /// <summary>
        /// 库位数量
        /// </summary>
        public int ZoneNumber { get; set; }

        /// <summary>
        /// 排序码
        /// </summary>
        public int SortOrder { get; set; }
        
        /// <summary>
        /// 是否快速选择
        /// </summary>
        public bool IsQuickSelect { get; set; }
        
        // 导航属性 - 库区集合
        public virtual ICollection<Zone> Zones { get; protected set; }
        
        protected Warehouse()
        {
            Zones = new List<Zone>();
        }
        
        public Warehouse(
            Guid id,
            string code,
            string name,
            string address = null,
            int status = 1,
            int warehouseType = 1) : base(id)
        {
            Code = code;
            Name = name;
            Address = address;
            Status = status;
            WarehouseType = warehouseType;
            Zones = new List<Zone>();
        }
    }
} 